/*
 ============================================================================
 Name		: ResponseHomepage.h
 Author	  : 
 Version	 : 1.0
 Copyright   :
 Description : CResponseHomepage declaration
 ============================================================================
 */

#ifndef RESPONSEHOMEPAGE_H
#define RESPONSEHOMEPAGE_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include "fWml.h"
#include "ResponseBase.h"

class CResponseHomepageData;
class CResponseMagazineItemData;
class CResponseMagazineCateData;

// CLASS DECLARATION

/**
 *  CResponseHomepage
 *
 */
class CResponseHomepage : public CServerResponseBase
{
public:
    // Constructors and destructor

    /**
     * Destructor.
     */
    ~CResponseHomepage();

    /**
     * Two-phased constructor.
     */
    static CResponseHomepage* NewL();

    /**
     * Two-phased constructor.
     */
    static CResponseHomepage* NewLC();

private:

    /**
     * Constructor for performing 1st stage construction
     */
    CResponseHomepage();

    /**
     * EPOC default constructor for performing 2nd stage construction
     */
    void ConstructL();
protected:
    /**
     *  from CServerResponseBase
     */
    void LoadValidResponseFromXmlNode(CElement* elementResponse);
private:
    void LoadMagazineItemsNode(CElement* elementRecommend, RPointerArray< CResponseMagazineItemData >* container);
    void LoadMagazineCatesNode(CElement* elementParent, RPointerArray< CResponseMagazineCateData >* cates);
    void LoadSearchTags(CElement* elementSearch, CDesC16Array* array);
public:
    CResponseHomepageData* _data;
};

#endif // RESPONSEHOMEPAGE_H
